package com.ctsi.security;

import com.ctsi.commons.util.response.Page;
import com.ctsi.security.domain.Permission;
import com.ctsi.security.domain.SRole;

import java.util.List;
import java.util.Map;


public interface PermissionSer {

	/**
	 * 保存对象
	 *
	 * @param permission
	 */
	public abstract void savePermission(Permission permission);

	/**
	 * 根据条件查询数据
	 *
	 * @param field
	 * @param args
	 * @return
	 */
	public abstract List<Permission> findPermission(String[] field, Object[] args);
	/**
	 * 以对象为参数删除对象
	 *
	 * @param permission
	 */
	public abstract void removePermission(Permission permission);

	
	public abstract void updatePermission(Permission permission);

	
	public abstract void removePermission(String id, String permissionId);

	
	public abstract List<Permission> findPermissionAll();

	
	public abstract List<Permission> findPermission(String userLogin,
                                                    String dataObjectType, String action,
                                                    Map<String, ? extends Object> params);

	
	public abstract List<String> findPermissionIdByPermType(
            String permissionTypeId);

	
	public abstract List<Permission> findPermissionByPermType(
            String permissionTypeId);

	
	public abstract Page<Permission> queryPermission(int pageSize,
													 int startIndex);

	
	public abstract Page queryPermission(int pageSize, int startIndex,
                                         String permissionTypeId);

	
	public abstract Page<Permission> queryPermission(String userLoginId,
                                                     String dataObjectType, String action, String searchPermId,
                                                     String permissionName, int pageSize, int startIndex,
                                                     String permissionTypeId);
	
	public abstract Page<Permission> queryPermission(String userLoginId,
                                                     String dataObjectType, String action, String searchPermId,
                                                     String permissionName, String pType, int pageSize, int startIndex,
                                                     String permissionTypeId);


	public abstract boolean valPermissionId(String permissionId);

	
	public abstract Permission findByPermission(String permissionId);

	
	public abstract Page<Permission> queryPermByLoginId(String userLoginId,
                                                        String dataObjectType, String action, String loginId,
                                                        Map<String, Object> conds, int start);

	
	public abstract List<Permission> queryAllPermByUserId(String userLoginId);

	
	public abstract Page<Permission> queryPermByLoginId(String loginId,
                                                        Map<String, Object> conds, int start);

	
	public abstract List<SRole> getSRoleByPartyId(String userLoginId,
												  String dataObjectType, String action, String permission);
}